3.1.52 \(\int \csc ^2(e+f x) (a+b \tan ^2(e+f x))^2 \, dx\) [52]

Optimal. Leaf size=46 \[ -\frac {a^2 \cot (e+f x)}{f}+\frac {2 a b \tan (e+f x)}{f}+\frac {b^2 \tan ^3(e+f x)}{3 f} \]

[Out]

-a^2*cot(f*x+e)/f+2*a*b*tan(f*x+e)/f+1/3*b^2*tan(f*x+e)^3/f

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {3744, 276} \begin {gather*} -\frac {a^2 \cot (e+f x)}{f}+\frac {2 a b \tan (e+f x)}{f}+\frac {b^2 \tan ^3(e+f x)}{3 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]^2*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

-((a^2*Cot[e + f*x])/f) + (2*a*b*Tan[e + f*x])/f + (b^2*Tan[e + f*x]^3)/(3*f)

Rule 276

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*(a + b*x^n)^p,
 x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0]

Rule 3744

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[c*(ff^(m + 1)/f), Subst[Int[x^m*((a + b*(ff*x)^n)^p/(c^2 + ff^2*x^2)
^(m/2 + 1)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2]

Rubi steps

\begin {align*} \int \csc ^2(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx &=\frac {\text {Subst}\left (\int \frac {\left (a+b x^2\right )^2}{x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {\text {Subst}\left (\int \left (2 a b+\frac {a^2}{x^2}+b^2 x^2\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {a^2 \cot (e+f x)}{f}+\frac {2 a b \tan (e+f x)}{f}+\frac {b^2 \tan ^3(e+f x)}{3 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.36, size = 44, normalized size = 0.96 \begin {gather*} \frac {-3 a^2 \cot (e+f x)+b \left (6 a-b+b \sec ^2(e+f x)\right ) \tan (e+f x)}{3 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Csc[e + f*x]^2*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

(-3*a^2*Cot[e + f*x] + b*(6*a - b + b*Sec[e + f*x]^2)*Tan[e + f*x])/(3*f)

________________________________________________________________________________________

Maple [A]
time = 0.11, size = 48, normalized size = 1.04

method result size
derivativedivides \(\frac {\frac {b^{2} \left (\sin ^{3}\left (f x +e \right )\right )}{3 \cos \left (f x +e \right )^{3}}+2 a b \tan \left (f x +e \right )-a^{2} \cot \left (f x +e \right )}{f}\) \(48\)
default \(\frac {\frac {b^{2} \left (\sin ^{3}\left (f x +e \right )\right )}{3 \cos \left (f x +e \right )^{3}}+2 a b \tan \left (f x +e \right )-a^{2} \cot \left (f x +e \right )}{f}\) \(48\)
risch \(-\frac {2 i \left (3 a^{2} {\mathrm e}^{6 i \left (f x +e \right )}-6 a b \,{\mathrm e}^{6 i \left (f x +e \right )}+3 b^{2} {\mathrm e}^{6 i \left (f x +e \right )}+9 a^{2} {\mathrm e}^{4 i \left (f x +e \right )}-6 a b \,{\mathrm e}^{4 i \left (f x +e \right )}-3 b^{2} {\mathrm e}^{4 i \left (f x +e \right )}+9 a^{2} {\mathrm e}^{2 i \left (f x +e \right )}+6 a b \,{\mathrm e}^{2 i \left (f x +e \right )}+b^{2} {\mathrm e}^{2 i \left (f x +e \right )}+3 a^{2}+6 a b -b^{2}\right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right ) \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}\) \(170\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)^2*(a+b*tan(f*x+e)^2)^2,x,method=_RETURNVERBOSE)

[Out]

1/f*(1/3*b^2*sin(f*x+e)^3/cos(f*x+e)^3+2*a*b*tan(f*x+e)-a^2*cot(f*x+e))

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 44, normalized size = 0.96 \begin {gather*} \frac {b^{2} \tan \left (f x + e\right )^{3} + 6 \, a b \tan \left (f x + e\right ) - \frac {3 \, a^{2}}{\tan \left (f x + e\right )}}{3 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^2*(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

1/3*(b^2*tan(f*x + e)^3 + 6*a*b*tan(f*x + e) - 3*a^2/tan(f*x + e))/f

________________________________________________________________________________________

Fricas [A]
time = 1.16, size = 75, normalized size = 1.63 \begin {gather*} -\frac {{\left (3 \, a^{2} + 6 \, a b - b^{2}\right )} \cos \left (f x + e\right )^{4} - 2 \, {\left (3 \, a b - b^{2}\right )} \cos \left (f x + e\right )^{2} - b^{2}}{3 \, f \cos \left (f x + e\right )^{3} \sin \left (f x + e\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^2*(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

-1/3*((3*a^2 + 6*a*b - b^2)*cos(f*x + e)^4 - 2*(3*a*b - b^2)*cos(f*x + e)^2 - b^2)/(f*cos(f*x + e)^3*sin(f*x +
 e))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \tan ^{2}{\left (e + f x \right )}\right )^{2} \csc ^{2}{\left (e + f x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)**2*(a+b*tan(f*x+e)**2)**2,x)

[Out]

Integral((a + b*tan(e + f*x)**2)**2*csc(e + f*x)**2, x)

________________________________________________________________________________________

Giac [A]
time = 0.81, size = 44, normalized size = 0.96 \begin {gather*} \frac {b^{2} \tan \left (f x + e\right )^{3} + 6 \, a b \tan \left (f x + e\right ) - \frac {3 \, a^{2}}{\tan \left (f x + e\right )}}{3 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^2*(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/3*(b^2*tan(f*x + e)^3 + 6*a*b*tan(f*x + e) - 3*a^2/tan(f*x + e))/f

________________________________________________________________________________________

Mupad [B]
time = 11.86, size = 67, normalized size = 1.46 \begin {gather*} \frac {-3\,a^2\,{\cos \left (e+f\,x\right )}^4+6\,a\,b\,{\cos \left (e+f\,x\right )}^2\,{\sin \left (e+f\,x\right )}^2+b^2\,{\sin \left (e+f\,x\right )}^4}{3\,f\,{\cos \left (e+f\,x\right )}^3\,\sin \left (e+f\,x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*tan(e + f*x)^2)^2/sin(e + f*x)^2,x)

[Out]

(b^2*sin(e + f*x)^4 - 3*a^2*cos(e + f*x)^4 + 6*a*b*cos(e + f*x)^2*sin(e + f*x)^2)/(3*f*cos(e + f*x)^3*sin(e +
f*x))

________________________________________________________________________________________